//
//  HZHomeTextView.swift
//  555wobo
//
//  Created by 黄某某 on 15/12/21.
//  Copyright © 2015年 黄某某. All rights reserved.
//

import UIKit

class HZHomeTextView: UIButton {
    init(imageName: String, title: String){
        super.init(frame:CGRectZero)
        setImage(UIImage(named: imageName), forState: UIControlState.Normal)
        setTitle(title, forState: UIControlState.Normal)
        setTitleColor(UIColor.orangeColor(), forState: UIControlState.Normal)
        sizeToFit()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews(){
        super.layoutSubviews()
        self.titleLabel?.frame.origin.x = 0
        self.imageView?.frame.origin.x = self.titleLabel!.frame.width + 3
    }
    

}
